package com.lindroy.androidplayer.logic.network2

import com.lindroy.androidplayer.logic.network2.Error

/**
 * @author Lin
 * @date 2021/4/15
 * @function 自定义错误信息
 */
/*data class AppException(
    var errorCode:Int,
    val errorMsg:String,
    val errorLog:String = ""
):Exception()*/
class AppException constructor(val errCode: Int, val errorMsg: String,val errorLog: String? = "") : Exception() {

    constructor(error: Error, e: Throwable?) : this(error.getKey(), error.getValue(), e?.message)

    override fun toString(): String {
        return "AppException(errCode=$errCode, errorMsg='$errorMsg', errorLog=$errorLog)"
    }

}